<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function Hero(name,age,sex,obj,hobby) {
        this.name=name;
        this.age=age;
        this.sex=sex;
        this.obj=obj;
        this.fangfa=function () {
            document.write("姓名："+this.name+"<br />今年："+this.age+"岁<br />性别："+this.sex+"<br />对象:"+this.obj+"<br />"+this.obj+"说：今天礼拜二，还要上课");
        }
    }
    var hero=new Hero("小明",18,"男","男朋友");
    hero.fangfa();
</script>
</html>